package trystero.lib.db;

public class Schema
{
   public static String dropTableStream()
   {
      return "drop table if exists stream";
   }

   public static String createTableStream()
   {
      return "create table stream (" +
         "id integer," +
         "reader_id text," +
         "title text," +
         "updated integer" +
      ")";
   }

   public static String dropTableItem()
   {
      return "drop table if exists item";
   }

   public static String createTableItem()
   {
      return "create table item (" +
         "stream_id integer," +
         "id integer unique," +
         "crawled integer," +
         "reader_id text," +
         "title text," +
         "published integer," +
         "updated integer," +
         "summary text," +
         "author text" +
      ")";
   }

   public static String dropTableLink()
   {
      return "drop table if exists link";
   }

   public static String createTableLink()
   {
      return "create table link (" +
         "item_id integer," +
         "type integer," +
         "href text," +
         "mime text," +
         "title text," +
         "length integer" +
      ")";
   }

   public static String dropTableOrigin()
   {
      return "drop table if exists origin";
   }

   public static String createTableOrigin()
   {
      return "create table origin (" +
         "item_id integer," +
         "stream text," +
         "title text," +
         "url text" +
      ")";
   }

   public static String dropTableCategory()
   {
      return "drop table if exists category";
   }

   public static String createTableCategory()
   {
      return "create table category (" + 
         "item_id integer," +
         "category text" +
      ")";
   }

   public static String dropTableUser()
   {
      return "drop table if exists user";
   }

   public static String createTableUser()
   {
      return "create table user (" +
         "item_id integer," +
         "user integer" +
      ")";
   }

   public static String dropTableComment()
   {
      return "drop table if exists comment";
   }

   public static String createTableComment()
   {
      return "create table comment (" +
	 "item_id integer," +
	 "reader_id text," +
	 "content text," +
	 "html text," +
	 "author text," +
	 "user text," +
	 "profile text," +
	 "params text," +
	 "venue text," +
	 "created integer," +
	 "modified integer" +
      ")";
   }
}
